require.config({
    paths: {
        'jquery': ['http://cdn.bootcss.com/jquery/2.2.4/jquery.min', '/js/lib/jquery.min'],
        'doT': '/js/lib/doT.min',
        'bootstrap': '/js/lib/bootstrap.min',
        'datetimepicker': '/js/lib/bootstrap-datetimepicker.min',
        'select2': '/js/lib/select2.min'
    },
    shim: {
        'bootstrap': ['jquery']
    }
});

require(['jquery', 'doT', 'common', 'bootstrap'], function($, doT, common) {
    $(function() {
        function refreshSchoolInfo() {
            var schoolInfoTmpl = doT.template($('#schoolInfoTmpl').text());
            var schoolInfo = { name: '华南师范大学', location: '广东广州', tangzhu: 'burning' };
            $('#schoolInfo').html(schoolInfoTmpl(schoolInfo));
        }

        refreshSchoolInfo();

        function refreshSchoolDetail() {
            var schoolDetailTmpl = doT.template($('#schoolDetailTmpl').text());
            var schoolDetail = { population: 1000, canteenNumber: 2 };
            $('#schoolDetail').append(schoolDetailTmpl(schoolDetail));
        }

        refreshSchoolDetail();
    });
});
